﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>问题详细</title>
    <script src="~/Assets/js/base/jquery.min.js"></script>
    <style>
        table {
            width: 200px;
            border-top: 1px solid #999;
            border-left: 1px solid #999;
        }

            table td {
                padding: 10px 30px;
                border-bottom: 1px solid #999;
                border-right: 1px solid #999;
            }

        table {
            width: 200px;
            border-top: 1px solid #999;
            border-left: 1px solid #999;
            border-spacing: 0; /*去掉单元格间隙*/
        }
        table, tr, td, th, tbody, thead, tfoot {
            page-break-inside: avoid !important;
        }
    </style>
    <script>
        window.onload = function () {
            var formid = '@(Request.QueryString["FormId"].IsEmpty() ? "0" : Request.QueryString["FormId"])';
            var formno = '@(Request.QueryString["FormNo"].IsEmpty() ? "" : Request.QueryString["FormNo"])';
            if (formid == 0 || formno == '') {
                return false;
            }
            LoadData(formid, formno);
        }

        function LoadData(formid, formno) {
             $.ajax({
                type: "POST",
                 url: '../HiddenTrouble/GetHiddenTroubleExportDetail',
                 data: { 'FormId': formid, 'FormNo': formno  },
                success: function (datas) {
                    if (datas != null) {
                        if (datas.Code = 100) {
                            var detail = datas.Data;
                            $("#FormNo").html(detail.FormNo);
                            $("#ParkName").html(detail.ParkName);
                            $("#PlaceName").html(detail.PlaceName);
                            $("#DepartmentName").html(detail.DepartmentName);
                            $("#ResponsibleUser").html(detail.ResponsibleUser);
                            $("#SourceName").html(detail.SourceName);
                            $("#LevelName").html(detail.LevelName);
                            $("#CategoryName").html(detail.CategoryName);
                            $("#SubCategoryName").html(detail.SubCategoryName);
                            $("#CheckTime").html(detail.CheckTimeStr);
                            $("#CreateUserName").html(detail.CreateUserName);
                            $("#Description").html(detail.Description);
                            $("#Requirement").html(detail.Requirement == null ? '' : detail.Requirement);

                            var solutionlist = detail.SolutionList;
                            var htmlcontent = "";
                            for (var i = 0; i < solutionlist.length; i++) {
                                var reclist = solutionlist[i].RectificationRecordList;
                                var type = '';
                                if (solutionlist.IsTemporary) {
                                    type = "临时措施";
                                } else {
                                    type = "立即整改";
                                }
                                htmlcontent += '<b style="margin:5px;">整改措施 '+(i+1)+"</b>";
                                htmlcontent += '<table style="width:100%;font-size:18px;font-family:微软雅黑;margin-top:10px;margin-bottom:10px;">';
                                htmlcontent += "<tr>";
                                htmlcontent += "<td><b>整改类型：</b><span>" + type + "</span></td>";
                                htmlcontent += "<td><b>计划完成时间：</b><span>" + solutionlist[i].PlanCompleteTimeStr + "</span></td>";
                                htmlcontent += "</tr>";
                                htmlcontent += "<tr>";
                                htmlcontent += "<td><b>联系部门：</b><span>" + (solutionlist[i].DepartmentName == null ? '' : solutionlist[i].DepartmentName) + "</span></td>";
                                htmlcontent += "<td><b>联 系 人：</b><span>" + (solutionlist[i].Responsible == null ? '' : solutionlist[i].Responsible) + "</span></td>";
                                htmlcontent += "</tr>";
                                if (solutionlist[i].DepartmentId != null) {
                                    htmlcontent += "<tr>";
                                    htmlcontent += "<td colspan='2'><b>设施设备类型及责任部门：</b><span>" + solutionlist[i].EquTypeAndDep + "</span></td>";
                                    htmlcontent += "</tr>";
                                }
                                htmlcontent += "<tr>";
                                htmlcontent += '<td colspan="2"><div style = "min-height:80px;height:auto;"><b>措施内容：</b><span>' + solutionlist[i].SolutionContent+'</span></div></td>';
                                htmlcontent += "</tr>";
                                if (reclist.length > 0) {
                                    htmlcontent += "<tr>";
                                    htmlcontent += "<td><b>整改时间：</b><span>" + reclist[0].OperateTimeStr + "</span></td>";
                                    htmlcontent += "<td><b>操 作 人：</b><span>" + reclist[0].EmployeeName + "</span></td>";
                                    htmlcontent += "</tr>";
                                    htmlcontent += "<tr>";
                                    htmlcontent += '<td colspan="2"><div style = "min-height:80px;height:auto;"><b>整改内容：</b><span>' + reclist[0].Description + '</span></div></td>';
                                    htmlcontent += "</tr>";
                                }
                                htmlcontent += "</table>";
                            }
                            $("#SolutionList").html(htmlcontent);
                        }


                    }
                }
            });
        }


    </script>
</head>
<body>
    <div style="width:980px;margin:20px auto;">
        <p style="width:100%;text-align:center;font-size:22px;font-weight:bold;">问题单详细表</p>
        <p>NO: <b id="FormNo"></b></p>
        <table style="width:100%;font-size:18px;font-family:微软雅黑;">
            <tr>
                <td><b>所在园区：</b><span id="ParkName"></span></td>
                <td><b>所在场所：</b><span id="PlaceName"></span></td>
            </tr>
            <tr>
                <td><b>责任部门：</b><span id="DepartmentName"></span></td>
                <td><b>责 任 人：</b><span id="ResponsibleUser"></span></td>
            </tr>
            <tr>
                <td><b>问题分类：</b><span id="CategoryName"></span></td>
                <td><b>问题子类：</b><span id="SubCategoryName"></span></td>
            </tr>
            <tr>
                <td><b>问题来源：</b><span id="SourceName"></span></td>
                <td><b>问题等级：</b><span id="LevelName"></span></td>
            </tr>
            <tr>
                <td><b>检查时间：</b><span id="CheckTime"></span></td>
                <td><b>登 记 人：</b><span id="CreateUserName"></span></td>
            </tr>
            <tr>
                <td colspan="2">
                    <div style="min-height:80px;height:auto;">
                        <b>问题内容：</b><span id="Description"></span>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <div style="min-height:80px;height:auto;">
                        <b>整改要求：</b><span id="Requirement"></span>
                    </div>
                </td>
            </tr>
        </table>
        <div style="width:100%; height:20px;">

        </div>
        <div style="width:100%;" id="SolutionList">

        </div>
    </div>
</body>
</html>
